home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / pango-1.0 / pango / pangoxft-render.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-25  |  4.7 KB  |  143 lines

  1. /* Pango
  2.  * pangoxft-render.h: Rendering routines for the Xft library
  3.  *
  4.  * Copyright (C) 2004 Red Hat Software
  5.  *
  6.  * This library is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU Library General Public
  8.  * License as published by the Free Software Foundation; either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * This library is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.     See the GNU
  14.  * Library General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU Library General Public
  17.  * License along with this library; if not, write to the
  18.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19.  * Boston, MA 02111-1307, USA.
  20.  */
  21.  
  22. #ifndef __PANGOXFT_RENDER_H__
  23. #define __PANGOXFT_RENDER_H__
  24.  
  25. #include <pango/pango-renderer.h>
  26.  
  27. G_BEGIN_DECLS
  28.  
  29. #define _XFT_NO_COMPAT
  30. #define _XFTCOMPAT_H_
  31. #include <X11/Xlib.h>
  32. #include <X11/Xft/Xft.h>
  33. #if defined(XftVersion) && XftVersion >= 20000
  34. #else
  35. #error "must have Xft version 2 or newer"
  36. #endif
  37.  
  38. typedef struct _PangoXftRenderer        PangoXftRenderer;
  39. typedef struct _PangoXftRendererClass   PangoXftRendererClass;
  40. typedef struct _PangoXftRendererPrivate PangoXftRendererPrivate;
  41.  
  42. #define PANGO_TYPE_XFT_RENDERER            (pango_xft_renderer_get_type())
  43. #define PANGO_XFT_RENDERER(object)         (G_TYPE_CHECK_INSTANCE_CAST ((object), PANGO_TYPE_XFT_RENDERER, PangoXftRenderer))
  44. #define PANGO_IS_XFT_RENDERER(object)      (G_TYPE_CHECK_INSTANCE_TYPE ((object), PANGO_TYPE_XFT_RENDERER))
  45. #define PANGO_XFT_RENDERER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), PANGO_TYPE_XFT_RENDERER, PangoXftRendererClass))
  46. #define PANGO_IS_XFT_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PANGO_TYPE_XFT_RENDERER))
  47. #define PANGO_XFT_RENDERER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), PANGO_TYPE_XFT_RENDERER, PangoXftRendererClass))
  48.  
  49. /**
  50.  * PangoXftRenderer
  51.  *
  52.  * #PangoXftRenderer is a subclass of #PangoRenderer used for rendering
  53.  * with Pango's Xft backend. It can be used directly, or it can be
  54.  * further subclassed to modify exactly how drawing of individual
  55.  * elements occurs.
  56.  *
  57.  * Since: 1.8
  58.  */
  59. struct _PangoXftRenderer
  60. {
  61.   /*< private >*/    
  62.   PangoRenderer parent_instance;
  63.  
  64.   Display *display;
  65.   int screen;
  66.   XftDraw *draw;
  67.  
  68.   PangoXftRendererPrivate *priv;
  69. };
  70.  
  71. /**
  72.  * PangoXftRendererClass
  73.  * @composite_trapezoids: draw the specified trapezoids using
  74.  *   the current color and other attributes for @part
  75.  * @composite_glyphs: draw the specified glyphs using
  76.  *   the current foreground color and other foreground
  77.  *   attributes 
  78.  *
  79.  * The class structure for #PangoXftRenderer
  80.  *
  81.  * Since: 1.8
  82.  */
  83. struct _PangoXftRendererClass
  84. {
  85.   /*< private >*/    
  86.   PangoRendererClass parent_class;
  87.  
  88.   /*< public >*/
  89.   void (*composite_trapezoids) (PangoXftRenderer *xftrenderer,
  90.                 PangoRenderPart   part,
  91.                 XTrapezoid       *trapezoids,
  92.                 int               n_trapezoids);
  93.   void (*composite_glyphs)     (PangoXftRenderer *xftrenderer,
  94.                 XftFont          *xft_font,
  95.                 XftGlyphSpec     *glyphs,
  96.                 int               n_glyphs);
  97. };
  98.  
  99. GType pango_xft_renderer_get_type    (void);
  100.  
  101. PangoRenderer *pango_xft_renderer_new                 (Display          *display,
  102.                                int               screen);
  103. void           pango_xft_renderer_set_draw            (PangoXftRenderer *xftrenderer,
  104.                                XftDraw          *draw);
  105. void           pango_xft_renderer_set_default_color   (PangoXftRenderer *xftrenderer,
  106.                                PangoColor       *default_color);
  107.  
  108. void pango_xft_render             (XftDraw          *draw,
  109.                    XftColor         *color,
  110.                    PangoFont        *font,
  111.                    PangoGlyphString *glyphs,
  112.                    gint              x,
  113.                    gint              y);
  114. void pango_xft_picture_render     (Display          *display,
  115.                    Picture           src_picture,
  116.                    Picture           dest_picture,
  117.                    PangoFont        *font,
  118.                    PangoGlyphString *glyphs,
  119.                    gint              x,
  120.                    gint              y);
  121. void pango_xft_render_transformed (XftDraw          *draw,
  122.                    XftColor         *color,
  123.                    PangoMatrix      *matrix,
  124.                    PangoFont        *font,
  125.                    PangoGlyphString *glyphs,
  126.                    int               x,
  127.                    int               y);
  128. void pango_xft_render_layout_line (XftDraw          *draw,
  129.                    XftColor         *color,
  130.                    PangoLayoutLine  *line,
  131.                    int               x,
  132.                    int               y);
  133. void pango_xft_render_layout      (XftDraw          *draw,
  134.                    XftColor         *color,
  135.                    PangoLayout      *layout,
  136.                    int               x,
  137.                    int               y);
  138.  
  139. G_END_DECLS
  140.  
  141. #endif /* __PANGOXFT_RENDER_H__ */
  142.  
  143.